\section{src/process/decode/decode.h \-File \-Reference}
\label{decode_8h}\index{src/process/decode/decode.\-h@{src/process/decode/decode.\-h}}
{\ttfamily \#include $<$config.\-h$>$}\*
{\ttfamily \#include $<$debug.\-h$>$}\*
{\ttfamily \#include $<$elf.\-h$>$}\*
{\ttfamily \#include $<$gelf.\-h$>$}\*
{\ttfamily \#include $<$libelf.\-h$>$}\*
{\ttfamily \#include $<$err.\-h$>$}\*
{\ttfamily \#include $<$fcntl.\-h$>$}\*
{\ttfamily \#include $<$stdio.\-h$>$}\*
{\ttfamily \#include $<$stdlib.\-h$>$}\*
{\ttfamily \#include $<$unistd.\-h$>$}\*
{\ttfamily \#include $<$assert.\-h$>$}\*
{\ttfamily \#include $<$common.\-h$>$}\*
\-Include dependency graph for decode.\-h\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{decode_8h__incl}
\end{center}
\end{figure}
\-This graph shows which files directly or indirectly include this file\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{decode_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{\-Data \-Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf \-\_\-reg\-\_\-values}
\begin{DoxyCompactList}\small\item\em \-Structure containing the attributes of the different types of records. \end{DoxyCompactList}\item 
struct {\bf \-\_\-optional}
\begin{DoxyCompactList}\small\item\em \-Optional \-Atributes. \end{DoxyCompactList}\item 
struct {\bf \-\_\-displacement}
\begin{DoxyCompactList}\small\item\em \-Displacement \-Atributes. \end{DoxyCompactList}\item 
struct {\bf \-\_\-inmediate}
\begin{DoxyCompactList}\small\item\em \-Inmediate \-Atributes. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{\-Defines}
\begin{DoxyCompactItemize}
\item 
\#define {\bf \-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E}~(0x0\-F)
\item 
\#define {\bf \-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M}~0
\item 
\#define {\bf \-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G}~1
\item 
\#define {\bf \-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8}~0
\item 
\#define {\bf \-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32}~1
\item 
\#define {\bf \-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R}~4
\begin{DoxyCompactList}\small\item\em \-Lists the different instruction sizes. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{\-Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct {\bf \-\_\-reg\-\_\-values} {\bf \-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S}
\item 
typedef union {\bf \-\_\-optional} {\bf \-O\-P\-T\-I\-O\-N\-A\-L}
\item 
typedef struct {\bf \-\_\-displacement} {\bf \-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T}
\item 
typedef struct {\bf \-\_\-inmediate} {\bf \-I\-N\-M\-E\-D\-I\-A\-T\-E}
\end{DoxyCompactItemize}
\subsection*{\-Enumerations}
\begin{DoxyCompactItemize}
\item 
enum {\bf \-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E} \{ {\bf \-S\-I\-Z\-E\-\_\-8} =  8, 
{\bf \-S\-I\-Z\-E\-\_\-16} = 16, 
{\bf \-S\-I\-Z\-E\-\_\-32} = 32, 
{\bf \-S\-I\-Z\-E\-\_\-64} = 64
 \}
\end{DoxyCompactItemize}
\subsection*{\-Functions}
\begin{DoxyCompactItemize}
\item 
char {\bf decode} (char $\ast$buf, {\bf \-U\-I\-N\-T8} $\ast$decoded\-Size, {\bf \-M\-A\-C\-H\-I\-N\-E\-\_\-\-I\-N\-S\-T\-R\-U\-C\-T\-I\-O\-N} $\ast$instruction\-Decoded)
\begin{DoxyCompactList}\small\item\em \-State machine that controls the disassembly process. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{\-Define \-Documentation}
\index{decode.\-h@{decode.\-h}!\-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R@{\-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R}}
\index{\-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R@{\-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R}!decode.h@{decode.\-h}}
\subsubsection[{\-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R}]{\setlength{\rightskip}{0pt plus 5cm}\#define {\bf \-M\-A\-X\-\_\-\-O\-P\-E\-R\-A\-N\-D\-\_\-\-N\-U\-M\-B\-E\-R}~4}\label{decode_8h_ad77ca705270713c8cee0da1e3131efcf}


\-Lists the different instruction sizes. 



\-Definition at line 35 of file decode.\-h.

\index{decode.\-h@{decode.\-h}!\-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G@{\-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G}}
\index{\-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G@{\-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G}!decode.h@{decode.\-h}}
\subsubsection[{\-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G}]{\setlength{\rightskip}{0pt plus 5cm}\#define {\bf \-M\-E\-M\-\_\-\-T\-O\-\_\-\-R\-E\-G}~1}\label{decode_8h_a10c55c5d5f31915bc0b532e05a9c26b4}


\-Definition at line 32 of file decode.\-h.

\index{decode.\-h@{decode.\-h}!\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32@{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32}}
\index{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32@{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32}!decode.h@{decode.\-h}}
\subsubsection[{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32}]{\setlength{\rightskip}{0pt plus 5cm}\#define {\bf \-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-16\-\_\-32}~1}\label{decode_8h_a98e8bd49575bfee527325412fedd5d1b}


\-Definition at line 34 of file decode.\-h.

\index{decode.\-h@{decode.\-h}!\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8@{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8}}
\index{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8@{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8}!decode.h@{decode.\-h}}
\subsubsection[{\-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8}]{\setlength{\rightskip}{0pt plus 5cm}\#define {\bf \-O\-P\-E\-R\-A\-N\-D\-\_\-\-S\-I\-Z\-E\-\_\-8}~0}\label{decode_8h_a516b510287e7d75486114e646b8f7cd5}


\-Definition at line 33 of file decode.\-h.

\index{decode.\-h@{decode.\-h}!\-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M@{\-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M}}
\index{\-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M@{\-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M}!decode.h@{decode.\-h}}
\subsubsection[{\-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M}]{\setlength{\rightskip}{0pt plus 5cm}\#define {\bf \-R\-E\-G\-\_\-\-T\-O\-\_\-\-M\-E\-M}~0}\label{decode_8h_af46288fed606aabf87d393e057b80d47}


\-Definition at line 31 of file decode.\-h.

\index{decode.\-h@{decode.\-h}!\-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E@{\-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E}}
\index{\-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E@{\-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E}!decode.h@{decode.\-h}}
\subsubsection[{\-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E}]{\setlength{\rightskip}{0pt plus 5cm}\#define {\bf \-T\-W\-O\-\_\-\-B\-Y\-T\-E\-\_\-\-O\-P\-C\-O\-D\-E}~(0x0\-F)}\label{decode_8h_a9b34f51c6f391e9e98cea40a041241c9}


\-Definition at line 29 of file decode.\-h.



\subsection{\-Typedef \-Documentation}
\index{decode.\-h@{decode.\-h}!\-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T@{\-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T}}
\index{\-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T@{\-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T}!decode.h@{decode.\-h}}
\subsubsection[{\-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf \-\_\-displacement}  {\bf \-D\-I\-S\-P\-L\-A\-C\-E\-M\-E\-N\-T}}\label{decode_8h_aa2fd339219810845994d6e4f46b97e49}
\index{decode.\-h@{decode.\-h}!\-I\-N\-M\-E\-D\-I\-A\-T\-E@{\-I\-N\-M\-E\-D\-I\-A\-T\-E}}
\index{\-I\-N\-M\-E\-D\-I\-A\-T\-E@{\-I\-N\-M\-E\-D\-I\-A\-T\-E}!decode.h@{decode.\-h}}
\subsubsection[{\-I\-N\-M\-E\-D\-I\-A\-T\-E}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf \-\_\-inmediate}  {\bf \-I\-N\-M\-E\-D\-I\-A\-T\-E}}\label{decode_8h_a59fc127f6cf115a35ddcd265ab18f736}
\index{decode.\-h@{decode.\-h}!\-O\-P\-T\-I\-O\-N\-A\-L@{\-O\-P\-T\-I\-O\-N\-A\-L}}
\index{\-O\-P\-T\-I\-O\-N\-A\-L@{\-O\-P\-T\-I\-O\-N\-A\-L}!decode.h@{decode.\-h}}
\subsubsection[{\-O\-P\-T\-I\-O\-N\-A\-L}]{\setlength{\rightskip}{0pt plus 5cm}typedef union {\bf \-\_\-optional}  {\bf \-O\-P\-T\-I\-O\-N\-A\-L}}\label{decode_8h_a536dcf8d9fd7964b03d315d81d8953ab}
\index{decode.\-h@{decode.\-h}!\-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S@{\-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S}}
\index{\-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S@{\-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S}!decode.h@{decode.\-h}}
\subsubsection[{\-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf \-\_\-reg\-\_\-values}  {\bf \-R\-E\-G\-\_\-\-V\-A\-L\-U\-E\-S}}\label{decode_8h_a92993569a1c5366c0406b371545e2f43}


\subsection{\-Enumeration \-Type \-Documentation}
\index{decode.\-h@{decode.\-h}!\-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E@{\-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E}}
\index{\-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E@{\-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E}!decode.h@{decode.\-h}}
\subsubsection[{\-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf \-I\-N\-S\-T\-\_\-\-D\-A\-T\-A\-\_\-\-S\-I\-Z\-E}}\label{decode_8h_ab08a50ead6f11683035e8b03e9a6ab76}
\begin{Desc}
\item[\-Enumerator\-: ]\par
\begin{description}
\index{\-S\-I\-Z\-E\-\_\-8@{\-S\-I\-Z\-E\-\_\-8}!decode.\-h@{decode.\-h}}\index{decode.\-h@{decode.\-h}!\-S\-I\-Z\-E\-\_\-8@{\-S\-I\-Z\-E\-\_\-8}}\item[{\em 
\-S\-I\-Z\-E\-\_\-8\label{decode_8h_ab08a50ead6f11683035e8b03e9a6ab76a9639e22aeeea626bf1cfbdc8a464ee15}
}]\index{\-S\-I\-Z\-E\-\_\-16@{\-S\-I\-Z\-E\-\_\-16}!decode.\-h@{decode.\-h}}\index{decode.\-h@{decode.\-h}!\-S\-I\-Z\-E\-\_\-16@{\-S\-I\-Z\-E\-\_\-16}}\item[{\em 
\-S\-I\-Z\-E\-\_\-16\label{decode_8h_ab08a50ead6f11683035e8b03e9a6ab76acaadd71d361a7b55bae5ab125e2485f3}
}]\index{\-S\-I\-Z\-E\-\_\-32@{\-S\-I\-Z\-E\-\_\-32}!decode.\-h@{decode.\-h}}\index{decode.\-h@{decode.\-h}!\-S\-I\-Z\-E\-\_\-32@{\-S\-I\-Z\-E\-\_\-32}}\item[{\em 
\-S\-I\-Z\-E\-\_\-32\label{decode_8h_ab08a50ead6f11683035e8b03e9a6ab76af8c2bd7889de0704f869521c127f1749}
}]\index{\-S\-I\-Z\-E\-\_\-64@{\-S\-I\-Z\-E\-\_\-64}!decode.\-h@{decode.\-h}}\index{decode.\-h@{decode.\-h}!\-S\-I\-Z\-E\-\_\-64@{\-S\-I\-Z\-E\-\_\-64}}\item[{\em 
\-S\-I\-Z\-E\-\_\-64\label{decode_8h_ab08a50ead6f11683035e8b03e9a6ab76aa211aed09197a479f3e2a24f39295eed}
}]\end{description}
\end{Desc}



\-Definition at line 38 of file decode.\-h.



\subsection{\-Function \-Documentation}
\index{decode.\-h@{decode.\-h}!decode@{decode}}
\index{decode@{decode}!decode.h@{decode.\-h}}
\subsubsection[{decode}]{\setlength{\rightskip}{0pt plus 5cm}char {\bf decode} (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{buf, }
\item[{{\bf \-U\-I\-N\-T8} $\ast$}]{decoded\-Size, }
\item[{{\bf \-M\-A\-C\-H\-I\-N\-E\-\_\-\-I\-N\-S\-T\-R\-U\-C\-T\-I\-O\-N} $\ast$}]{instruction\-Decoded}
\end{DoxyParamCaption}
)}\label{decode_8h_ad9d02712baa4494872edd1c26b3b73ee}


\-State machine that controls the disassembly process. 


\begin{DoxyParams}{\-Parameters}
{\em buf} & \-Buffer containing the piece of the file to be analyzed \\
\hline
{\em decoded\-Size} & \-Size of the instruction to be decoded \\
\hline
{\em instruction\-Decoded} & \-Object containing the attibutes of the decoded instruction \\
\hline
\end{DoxyParams}


\-Definition at line 577 of file decode.\-c.

